const express = require('express');
const bodyparser = require('body-parser')
const app = express();

app.use(bodyparser.urlencoded({extended: false}))
app.use(bodyparser.json({type: 'multipart/form-data'}));

app.use((req, res, next) => {
        res.header("Access-Control-Allow-Origin", "*");
        res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
        next();
})

app.get('/', (req, res) => {
	// res.send('waaaa')
	res.send('nooo')
})

app.post('/user', (req, res) => {
	console.log(req.body)
	console.log(req.body.a)
	res.send('waaaa')
	// res.send('nooo')
})

app.listen(3002, () => console.log('port 3002 bound..'))